package com.terrace.web.tagext.easyui.provider;

import com.terrace.web.tagext.easyui.support.BaseTagSupport;

/**
 * 表格拼装
 * @author jiangyg
 *
 */
public abstract class GridAssembleProvider extends BaseTagSupport implements DataOptionsProvider, GridProvider {
	
	private static final long serialVersionUID = -2087480051545037561L;

	/**
	 * 构建表格
	 */
	public String bulidGrid() {
		StringBuffer sb = new StringBuffer();
		
		// 生成标签
		sb.append(this.createGridContainer());
		sb.append(this.createGridToolBar());
		
		// 生成表格js
		sb.append("<script type=\"text/javascript\">");
		
		//---------------------页面加载事件开始-------------------
		sb.append("$(function() {");
		
		sb.append(this.createInitGridJS());

		sb.append(this.createGridOnLoadHtmlEvent());
		
		sb.append(this.createGridPager());
		
		sb.append("});");
		//---------------------页面加载事件结束-------------------
		
		sb.append(this.createGridCommonUseFuncs());
		
		sb.append("</script>");
		return sb.toString();
	}

}
